<?php
    

/*	add_action( 'after_setup_theme', 'seo_setup', 11);
	function seo_setup() {		
		$data = cv_get_option();
		// disable seo
	//	echo 'ddddddddddddddddddddddddddd';
	//	echo $data['seo_disable_seo'];
		if($data['seo_disable_seo'] == true)		
		{
			//if ( current_theme_supports( 'hybrid-core-seo' ) )
				remove_theme_support('hybrid-core-seo');
		}
		else
		{
			//if ( !current_theme_supports( 'hybrid-core-seo' ) )
	//			echo 'ffffffffffffffffffff';
				add_theme_support('hybrid-core-seo');
		}
	}	
*/
	/**
     * Add Custom title    
     */
	add_filter( hybrid_get_prefix() . '_home_document_title', cv_custom_titles );
	function cv_custom_titles( $doctitle ) {
		$data = cv_get_option();
		if($data['seo_custom_titles'] != '')
			$doctitle = $data['seo_custom_titles'];
			
		return $doctitle;
	}

	/**
     * Add Custom meta description    
     */
	add_filter( hybrid_get_prefix() . '_home_meta_description', cv_meta_description );
	function cv_meta_description( $description ) {
		$data = cv_get_option();
		
		if($data['seo_meta_description'] != '')
		{
			$description = $data['seo_meta_description'];
			return '<meta name="description" content="' . str_replace( array( "\r", "\n", "\t" ), '', esc_attr( strip_tags( $description ) ) ) . '" />' . "\n";
		}	
		
		return $description;
	}
	
	/**
     * Add Custom title    
     */
	add_filter( hybrid_get_prefix() . '_home_meta_keywords', cv_meta_keywords );
	function cv_meta_keywords( $keywords ) {
		$data = cv_get_option();
		if($data['seo_meta_keywords'] != '')
		{
			$keywords = $data['seo_meta_keywords'];
			return '<meta name="keywords" content="' . esc_attr( strip_tags( $keywords ) ) . '" />' . "\n";
		}
			
		return $keywords;
	}
	
?>
